<template>
  <div>
    <div class="loadingbox" v-if="isloading">
      <ClipLoader class="loading"></ClipLoader>
    </div>
    <router-view />
  </div>
</template>

<script>
import ClipLoader from "vue-spinner/src/ClipLoader.vue";
export default {
  name: "App",
  components: {
    ClipLoader,
  },
  computed: {
    getisloading() {
      return this.$store.getters.GetIsloading;
    },
  },
  watch: {
    getisloading: {
      handler(val) {
        this.isloading = val;
      },
    },
  },
  data() {
    return {
      isloading: false,
    };
  },
};
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>

<style scoped>
.loadingbox {
  width: 100%;
  height: 100%;
  position: fixed;
  z-index: 9999;
}
.loading {
  width: 50px;
  height: 50px;
  position: absolute;
  left: 45%;
  top: 40%;
}
</style>
